package com.example.media.controller;


import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.example.media.annotation.BloomFilter;
import com.example.media.entity.MacType;
import com.example.media.service.IMacTypeService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author tangxinmao
 * @since 2020-01-10
 */
@RestController
@RequestMapping("macType")
@RequiredArgsConstructor(onConstructor_ = @Autowired)
public class MacTypeController {
    private final IMacTypeService iMacTypeService;

    @PostMapping(path = "list")
    @BloomFilter
    public ResponseEntity list(@RequestBody MacType macType) {
        List<MacType> list = iMacTypeService.list(Wrappers.query(macType));
        return ResponseEntity.ok(list);
    }
}
